<template>
  <view class="main">
    <view class="list" v-for="(item, index) in getSystemRows" :key="index"
      @click="$goUrl(`/pages/message/pages/detail?id=${item?.noticeId}&type=1`)">
      <view class="item">
        <view class="top dispaly-just-between">
          <view class="title">系统消息</view>
          <view class="time">{{ item?.createTime }}</view>
        </view>
        <view class="middle dispaly-center">
          <view class="desc over-1"> {{ item?.noticeTitle }}</view>
        </view>
      </view>
    </view>
    <LoadMore v-if="!getSystemRows && getSystemRows.length <= 0" />
  </view>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { getSystemMessage } from "@/api/apiList";

const getSystemRows = ref();
const getSystem = async () => {
  const response = await getSystemMessage({ pageSize: 999, pageNum: 1, noticeType: 2 });
  if (response.code == 200) {
    getSystemRows.value = response?.rows;
  }
};
getSystem();
</script>

<style lang="scss" scoped>
.main {
  padding: 30rpx;

  .list {
    margin-bottom: 20rpx;

    .list:last-child {
      margin-bottom: 0;
    }

    .item {
      border-radius: 16rpx;
      background-color: #fff;
      padding: 20rpx;

      .top {
        .title {
          font-family: PingFang SC Regular;
          font-size: 32rpx;
          font-weight: normal;
          color: #111111;
        }

        .time {
          font-family: PingFang SC Regular;
          font-size: 24rpx;
          color: #999999;
        }
      }

      .middle {
        border-bottom: 1rpx solid #eee;
        padding-bottom: 24rpx;

        .desc {
          font-family: PingFang SC Regular;
          font-size: 26rpx;
        }

        .desc {
          color: #0753fd;
        }
      }
    }
  }
}
</style>
